import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:liuxlcommon/view/my_box.dart';
import 'package:love_newf/generated/assets.dart';

class MyAppBarTransparent extends AppBar {
  List<Widget>? actions;

  MyAppBarTransparent(_title,
      {super.key, this.actions, isBack = true, backClick, titleColor})
      : super(
          leading: isBack
              ? IconButton(
                  icon: Icon(Icons.close,size: 20.w,color: Colors.white,),
                  onPressed: backClick ?? () => Get.back(),
                )
              : null,
          elevation: 0,
          centerTitle: true,
          // 标题居中
          backgroundColor: Colors.transparent,

          title: (_title is Widget)
              ? _title
              : Text(_title,
                  style: TextStyle(
                      fontSize: 18.sp,
                      color: titleColor ?? Colors.white,
                      fontWeight: FontWeight.w600)),
          actions: actions ?? [],
        );
}
